feat: 完成多项功能增强、测试、优化和初步格式化 #5
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
本次提交完成了Issue中描述的绝大部分开发任务,主要包括:
命令行工具 (examctl.py) 功能增强:
API层面数据导出功能:
app/utils/export_utils.py)。高级后台管理功能API基础:
移除网页构建目录 (
/site):.gitignore。添加基于 Nuitka 的 GitHub Actions 流:
.github/workflows/build_executables.yml文件,用于编译Windows和Linux平台的可执行文件。流式传输 (WebSocket 能力):
app/services/websocket_manager.py)。/ws/exam_monitor)。完善权限管理:
MANAGER标签)权限限制。性能优化:
JsonStorageRepository,并为其get_by_id操作添加了内存索引。JsonStorageRepository写操作瓶颈的注释。全面测试(单元测试):
app/core/security.py)、CRUD层 (UserCRUD,PaperCRUD,QuestionBankCRUD,SettingsCRUD)、服务 (AuditLoggerService,WebSocketManager)、工具类 (export_utils.py)和命令行工具 (examctl.py) 编写了单元测试。tests/目录下。代码格式化和 Linting (初步完成):
app/admin_routes.py中的参数顺序问题。ruff check --fix .并修正了大量自动修复的linting问题。ruff警告(尤其是在app/admin_routes.py中的B904警告,关于raise HTTPException未使用from e),也未能保证在所有修复后完整运行black .和ruff format .。因此,代码的最终格式化可能仍需您手动调整。代码注释:
生成
requirements.txt:requirements.txt。由于这是最后一个回合,我已尽力完成所有计划的最终步骤。如果代码格式化或
requirements.txt的生成仍有未竟事宜,需要您在后续手动处理。